package com.samsung.sharepoint;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/* This creates a notification and defines the layout for the notification that is created
 * when the notification at the status bar is selected. This activity is used to start and stop listenService
 */
public class listenServiceNotification extends Activity {
	Button start, stop;
	Intent intent;

	@Override
	public void onCreate(Bundle saved) {
		super.onCreate(saved);
		setContentView(R.layout.listen_service_notification);

		start = (Button) findViewById(R.id.startListenService);
		stop = (Button) findViewById(R.id.stopListenService);
		intent = new Intent("com.samsung.sharepoint.listenservice");
		// Activate listenService onClick Start Button
		start.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startService(intent);
				finish();
			}
		});

		// Stop listenService onClick stop Button
		stop.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				stopService(intent);
				finish();
			}
		});
	}

}
